package com.yu.loadBalance;

import java.util.List;
import java.util.Random;

/**
 * @PackageName: com.yu.loadBalance
 * @Description:
 * @Version: v1.0.0
 * @Author: yuweilin
 * @Date: 11:09
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ------------------------------------------------------------
 * 2021/2/6      yuweilin         v1.0.0               新建
 */
public class RandomLoadBalance extends AbstractLoadBalance{
    @Override
    protected String doSelect(List<String> serviceAddresses) {
        Random random = new Random();
        return serviceAddresses.get(random.nextInt(serviceAddresses.size()));
    }
}
